package de.QuizCommunity;

import de.QuizCommunity.service.Benutzer_Put;
import de.QuizCommunity.util.AppVariabels;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class Quiz_Ende extends Activity {
	@Override
	public void onCreate(Bundle icicle) {
	super.onCreate(icicle);
	setContentView(R.layout.quiz_ende);
	AppVariabels appVar = AppVariabels.getInstance();
	Intent i = getIntent();
	TextView textView = (TextView)findViewById(R.id.textView2);
	textView.setText("Sie haben "+i.getIntExtra("richtige", 0)+" Frage(n) richtig beantwortet. Zeit: "+i.getStringExtra("Zeit")+" min");
	Benutzer_Put.putBenutzer(appVar.user.getIdBenutzer(), i.getIntExtra("richtige", 0));
	appVar.user.setRichtig_beantwortete_Fragen(appVar.user.getRichtig_beantwortete_Fragen()+i.getIntExtra("richtige", 0));
	
	final Button button = (Button) findViewById(R.id.button1);
	final Button btnFrageBewerten = (Button) findViewById(R.id.button2);
	
	button.setOnClickListener(new View.OnClickListener() {

		public void onClick(View v) {
			Intent in = new Intent(Quiz_Ende.this,Menue.class);
			startActivity(in);
			
		}
		
	});
	
	btnFrageBewerten.setOnClickListener(new View.OnClickListener() {
		
		public void onClick(View v) {
			Intent in = new Intent(Quiz_Ende.this,Act_Bewertung.class);
			startActivity(in);
		}
	});
	
	
}}
